import React from "react";
import { Tabs } from "antd";

const { TabPane } = Tabs;

export default ({ items = [], type = "card", activeKey, onChange }) => (
  <Tabs type={type} activeKey={activeKey} onChange={onChange}>
    {items.map(({ tab, key, content }) => {
      return (
        <TabPane tab={tab} key={key}>
          {content}
        </TabPane>
      );
    })}
  </Tabs>
);
